#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "GLDisplay.h"
#include <QDebug>



MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)

{
    ui->setupUi(this);

    connect(ui->actionWireFrame, SIGNAL(toggled(bool)), this, SIGNAL(wireframeClicked(bool)));
    connect(ui->actionLight_Rotation, SIGNAL(toggled(bool)), this, SIGNAL(lightRotationToggle(bool)));
    connect(ui->actionSaveImageAs, SIGNAL(triggered()), this, SIGNAL(saveResultAsImage()));
    connect(ui->radioObj1, SIGNAL(clicked(bool)), this, SLOT(radio(bool)));
    connect(ui->radioObj2, SIGNAL(clicked(bool)), this, SLOT(radio(bool)));
    connect(ui->Colorselector, SIGNAL(activated(int)), this, SLOT(colorselected(int)));
    connect(ui->BotaShader, SIGNAL(toggled(bool)), this, SLOT(shaderselected(bool)));

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::setGLDisplay(GLDisplay *display)
{
    ui->verticalLayout->addWidget(display);
}

void MainWindow::radio(bool)
{
    emit radioEvent(ui->radioObj1->isChecked(), ui->radioObj2->isChecked());
}

void MainWindow::colorselected(int){

    emit colorchoose(ui->Colorselector->currentIndex());
}

void MainWindow::shaderselected(bool){

    emit ShaderSelect(ui->BotaShader->isChecked());

}

